package gjbsh.bangong.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

import gjbsh.support.AppGlobalConfig;
import gjbsh.support.LogInterceptor;
import gjbsh.support.LoginInterceptor;

@Configuration
public class WebMvcCfg extends WebMvcConfigurationSupport {

	@Autowired
	AppGlobalConfig gconfig;

	@Autowired
	LoginInterceptor loginInterceptor;

	@Autowired
	LogInterceptor logInterceptor;

	@Override
	protected void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(logInterceptor).addPathPatterns("/**");
		registry.addInterceptor(loginInterceptor).addPathPatterns("/**").excludePathPatterns("/UserCheckCode",
				"/users/register","/activate_jj","/activate_bg","/checkcode","/dept/find_shengdept",
				"/dept_guanliyuan/add_dept_and_guanliyuan","/user/find_by_deptname_and_username_and_email");
		
		super.addInterceptors(registry);
	}

}
